package cn.hongwei.controller;

import cn.hongwei.result.R;
import cn.hongwei.service.SmsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
@RestController
@RequestMapping("/api/sms")
public class SmsController {
    @Autowired
    SmsService smsService;
    //发送短信接口
    @GetMapping("sendMsg/{mobile}")
    public R sendMsg(@PathVariable String mobile){
        //用户传入手机号码，后台给该手机发送短信验证码 ，用户在前台页面中按照自己手机收到的验证码输入
        smsService.sendMsg(mobile);
        return R.ok();
    }

}
